﻿using System.Collections;
using System;
namespace MyFloridaHouse.libSvDTO
{
	/// <summary>
	/// Point describes a lat/long.
	/// </summary>
    public class PointDTO 
    {
        public PointDTO()
        {
        }

        public PointDTO(double lat, double lon)
        {
            latitude = lat;
            longitude = lon;
        }

		/// <summary>
		/// Gets or sets the longitude.
		/// </summary>
		/// <value>The longitude.</value>
        public double longitude {get; set; }
		/// <summary>
		/// Gets or sets the latitude.
		/// </summary>
		/// <value>The latitude.</value>
        public double latitude {get; set; }

        public bool Compare(PointDTO b)
        {
            if ( (this.latitude.Equals(b.latitude))
                & (this.longitude.Equals(b.longitude))
                )
            {
                return true;
            }
            else
            {
                return false;
            }
        }


        public bool Compare(PointDTO b, int roundDecimalPoints)
        {
            if ((Math.Round(this.latitude, roundDecimalPoints).Equals(Math.Round(b.latitude, roundDecimalPoints)))
                & (Math.Round(this.longitude,roundDecimalPoints).Equals(Math.Round(b.longitude,roundDecimalPoints)))
                )
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
